package com.lk.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.security.oauth2.provider.token.ConsumerTokenServices;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 清楚token
 *
 * @author : lk
 * @date 2021/11/20 21:33
 **/
@RestController
@RequestMapping("/oauth")
public class TokenController {


    @Autowired
    @Qualifier("consumerTokenServices")
    private ConsumerTokenServices consumerTokenServices;

    @GetMapping("/removeToken")
    public Boolean removeToken(String accessToken) {
        return consumerTokenServices.revokeToken(accessToken);
    }
}
